<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <title>网站后台管理模版</title>
    <link rel="stylesheet" type="text/css" href="/static/admin/layui/css/layui.css" />
    <link rel="stylesheet" type="text/css" href="/static/admin/css/admin.css" />
</head>

<body>
<div class="page-content-wrap clearfix">
    <form class="layui-form">
        <div class="layui-tab">
            <ul class="layui-tab-title">
                <li class="layui-this">产品添加</li>
            </ul>
            <div class="layui-tab-content">
                <div class="layui-tab-item"></div>
                <div class="layui-tab-item layui-show">
                    <div class="layui-form-item">
                        <label class="layui-form-label">产品标题：</label>
                        <div class="layui-input-block">
                            <input type="text" name="title" required lay-verify="required" placeholder="请输入产品标题" autocomplete="off" class="layui-input">
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">图像上传：</label>
                        <div class="layui-input-block">
                            <input type="file" name="upload" class="layui-upload-file">
                            <input type="hidden" id="file" name="imgUrl">
                        </div>
                    </div>


                    <div class="layui-form-item">
                        <label class="layui-form-label">原价：</label>
                        <div class="layui-input-block">
                            <input type="text" name="oldProce" placeholder="请输入原价" autocomplete="off" class="layui-input">
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">现价：</label>
                        <div class="layui-input-block">
                            <input type="text" name="nowPrice" placeholder="请输入现价" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">是否热门：</label>
                        <div class="layui-input-block">
                            <select name="ishot" lay-verify="required">
                                <option value="">请选择是否热门</option>
                                <optgroup label="">
                                    <option value="是" selected="">是</option>
                                    <option value="否">否</option>
                                </optgroup>
                            </select>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">库存：</label>
                        <div class="layui-input-block">
                            <input type="text" name="quantity" placeholder="请输入库存" autocomplete="off" class="layui-input">
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">点击量：</label>
                        <div class="layui-input-block">
                            <input type="text" name="cilckNum" placeholder="请输入点击量" autocomplete="off" class="layui-input">
                        </div>
                    </div>

                    <div class="layui-form-item layui-form-text">
                        <label class="layui-form-label">描述：</label>
                        <div class="layui-input-block">
                            <textarea placeholder="请输入描述" name="productDesc" class="layui-textarea"></textarea>
                        </div>
                    </div>
                </div>
                <div class="layui-tab-item">

                </div>
            </div>
        </div>
        <div class="layui-form-item" style="padding-left: 10px;">
            <div class="layui-input-block">
                <button class="layui-btn layui-btn-normal" lay-submit lay-filter="formDemo">立即提交</button>
                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
            </div>
        </div>
    </form>
</div>
<script type="text/javascript">
    var SCOPE = {
        static: '/static',
        index: '/admin/category/index.html',
        add: 'add.html',
        save: '/admin/category/save.html',
        edit: 'add.html',
        updateEdit: '/admin/category/updateedit.html',
        status: '/admin/category/updatestatus.html',
        del: '/admin/category/del.html',
        delAll: '/admin/category/deleteall.html',
        listOrderAll: '/admin/category/listorderall.html'
    }
</script>
<script src="/static/admin/layui/layui.js" type="text/javascript" charset="utf-8"></script>
<script src="/static/admin/js/common.js" type="text/javascript" charset="utf-8"></script>
<script src="/js/jquery.1.10.1.min.js" type="text/javascript"></script>
<script>
    //Demo
    layui.use(['form'], function() {
        var form = layui.form();
        form.render();
        //监听提交
        form.on('submit(formDemo)', function(data) {

        });
    });

    layui.use(['upload'], function() {
        layui.upload({
            url: '/image/upload',
            success: function(result) {
                $("#file").val(result.data);
                // console.log(result); //上传成功返回值，必须为json格式
            }
        });
    });
</script>
</body>

</html>
